package com.ocom.aiot.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ocom.aiot.dao.IDaoUserRoles;
import com.ocom.aiot.service.UserRolesService;
import com.ocom.common.entity.aiot.EntityUserRoles;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class RoleInfoServiceImpl extends ServiceImpl<IDaoUserRoles, EntityUserRoles> implements UserRolesService {

    @Autowired
    private IDaoUserRoles userRoles;

    //获取userRole集合
    @Override
    public List<EntityUserRoles> GetUserRoles(Long userId) {
        QueryWrapper<EntityUserRoles> query = Wrappers.query();
        query.eq("user_id",userId);
        return userRoles.selectList(query);
    }
}
